<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f = "http://java.sun.com/jsf/core"
      >
    <h:body>
    	
    	<ui:composition template="/template/commonLayout.xhtml">
    	
    		<ui:define name="content">
		<p:messages id="messages" showDetail="true" autoUpdate="true"
				closable="true" />
			<h3>Add TimeInterval</h3>
			<h:form id="addTimeIntervalForm">
				<p:growl id="msgs" showDetail="true" />
				<!-- Date/Timepicker -->
				<table id="intervalAdd_table">
				<tr>
					<td><p:outputLabel for="datetime1" value="From:" style="width:250px"/></td>
					<td><p:calendar id="datetime1" value="#{timeIntervalView.from_Date}"
						pattern="dd/MM/yyyy HH:mm" style="width:250px"/></td>
				</tr>
				<tr>
					<td><p:outputLabel for="datetime2" value="To:" style="width:250px"/></td>
					<td><p:calendar id="datetime2" value="#{timeIntervalView.to_Date}"
						pattern="dd/MM/yyyy HH:mm" style="width:250px"/></td>
				</tr>

					<!-- Activity Checkbox -->
				<tr>
					<td><p:outputLabel for="activity" value="Activity:" style="width:250px"/></td>
					<td><p:selectOneListbox id="activity"
						value="#{timeIntervalView.selectedActivity}" label="Activity:"
						filter="true" filterMatchMode="startsWith" style="width:250px">
						<f:selectItems value="#{timeIntervalView.getActivityNames()}" />
					</p:selectOneListbox></td>
				</tr>
				<tr>
					<!-- Comment Inputfield -->
					<td><p:outputLabel for="comment" value="Add Comment:" style="width:250px"/></td>
					<td><p:inputTextarea id="comment" rows="4" cols="30"
						value="#{timeIntervalView.comment}" style="width:250px" /></td>
				</tr>
				<tr>
					<!-- Submit button and Cancel button-->
					<td><h:commandButton id="submitTimeInterval" styleClass="login"
						value="Submit" action="#{timeIntervalView.validate()}" /></td>
					<td><h:link outcome="/index.xhtml" value="Cancel" /></td>
				</tr>
				</table>
			</h:form>
		</ui:define>    		
    	</ui:composition>
    	
    </h:body>

</html>